﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void Button1_Click(object sender, EventArgs e)
        {
            if(textBox1.Text==string.Empty || textBox2.Text == string.Empty)
            {
                MessageBox.Show("请输入用户名或密码！", "登录提示");
                clear();
                return;
            }
            if(!textBox1.Text.Equals("admin") || !textBox2.Text.Equals("173967"))
            {
                MessageBox.Show("用户名或密码错误！", "登录提示");
                clear();
                return;
            }
            else
            {
                MessageBox.Show("欢迎您登录本系统！", "登录提示");
                clear();

            }
        }

        public void clear()
        {
            textBox1.Clear();
            textBox2.Clear();
            textBox1.Focus();
        }
    }
}
